from typing import List
from pydantic import BaseModel, Field

class Blackboard(BaseModel):
    size: int = 4000
    color: str = Field(..., alias='颜色', description='黑板的颜色，可选green和black')
    #color: str
class Table(BaseModel):
    position: str

class ClassRoom(BaseModel):
    blackboard: Blackboard
    tables: List[Table]

m = ClassRoom(
    blackboard={'颜色': 'green'},  # 使用别名 '颜色'
    #blackboard={'color': 'green'},
    tables=[{'position': '第一排左1'}, {'position': '第一排左2'}]
)

print(m)
print(m.model_dump())